home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 September / Ahoy_Magazine_86-09_1986_Double_L.d64 / comal article < prev    next >
Text File  |  2022-10-26  |  5KB  |  177 lines

  1. THE BEST FIRST LANGUAGE
  2.  
  3. by Sol Katz
  4.  
  5. A question that always comes up when
  6. talking with new computer owners is
  7. "What language should I learn?" For
  8. the C64, the answer must be COMAL.
  9. COMAL (COMmon Algorithmic Language)
  10. is the most user friendly language
  11. written to date. If you read
  12. Compute's Gazette, every couple of
  13. issues, there are programs to improve
  14. BASIC. If you're lucky enough, some
  15. of them work together. COMAL has many
  16. of these improvements built in.
  17.  
  18. The most user friendly feature of
  19. COMAL is its syntax checker. After
  20. you enter a newly typed line, it
  21. checks it for mistakes. It will point
  22. to where it thinks you made the
  23. mistake and tells you why it isn't
  24. happy. Messages like "Expect a colon
  25. here" or "Unbalanced parenthesis"
  26. help you fix your mistake at the time
  27. you type it. As soon as you correct
  28. the mistake COMAL lets you continue.
  29. In other words, COMAL will not accept
  30. a line with a syntax error.
  31.  
  32. The next really user friendly feature
  33. of COMAL is automatic formatting.
  34. COMAL wants you to be able to read
  35. your programs, so it takes out extra
  36. spaces in each line and automatically
  37. indents whenever you use structured
  38. programming. COMAL is a structured
  39. programming language, just as Pascal,
  40. C, FORTRAN 77, and COBOL are. Once
  41. you learn COMAL, it is only a small
  42. step to picking up other structured
  43. languages. BASIC (and older versions
  44. of FORTRAN) depend on GOTO statements
  45. for branching, while structured
  46. languages only use GOTO for very
  47. advanced level programming, and
  48. rarely at that. The structures of
  49. COMAL include:
  50.  
  51. IF...THEN...ELIF...ELSE...ENDIF
  52. CASE..OF...WHEN...OTHERWISE...ENDCASE
  53. WHILE...DO...ENDWHILE
  54. REPEAT...UNTIL
  55. FOR...STEP...ENDFOR
  56.  
  57. COMAL includes its own disk operating
  58. system so you no longer have to open
  59. channels to the disk drive (eg. OPEN
  60. 15,8,15, etc.) before you can use
  61. your drive. You can look at your
  62. directory using CAT (for CATalog)
  63. without destroying a program in
  64. memory. You can easily LOAD, SAVE, or
  65. DELETE a program, all without the
  66. ",8" suffix, and/or without opening
  67. the command channel.
  68.  
  69. COMAL is also user friendly when
  70. entering or editing a program. The
  71. AUTO command automatically supplies
  72. line numbers. [Editor Note: COMAL
  73. uses line numbers only for editing
  74. purposes. They are not used as
  75. addresses as is the case in BASIC].
  76. The syntax of the AUTO command tells
  77. COMAL what line number to start with
  78. and what number to increment the line
  79. number with. So, if you like your
  80. programs to start with 2468 and to go
  81. up with 3's, you can do it. If you
  82. want to delete a range of lines you
  83. do it with:
  84.  
  85. DELETE linenumber-linenumber.
  86.  
  87. You can also list a range of lines
  88. the same way, and to be user
  89. friendly, COMAL also lets you stop
  90. and start the listing by hitting the
  91. space bar. COMAL also allows you to
  92. use the existing Commodore screen
  93. editing capabilities.
  94.  
  95. For advanced users, COMAL has user
  96. defined functions allowing for
  97. multiple statements and multiple
  98. returns, depending on the calculated
  99. values. Compare that with BASIC which
  100. allows only one statement. COMAL
  101. procedures allow local and global
  102. variables, and also allow passing of
  103. arrays as paramenters. If you don't
  104. know what this means, that's OK since
  105. BASIC doesn't allow it anyway, but
  106. FORTRAN, C, and Pascal use procedures
  107. extensively. COMAL allows you to
  108. create new commands using procedures.
  109.  
  110. Then too, COMAL has Logo-like Turtle
  111. Graphics. If you've read about Logo
  112. and want to try it (or want your kids
  113. to try it) you can have it without
  114. getting still another language disk.
  115. In addition, all the Logo commands
  116. can be used within any COMAL program.
  117.  
  118. COMAL frees you from dealing with
  119. many of the PEEKs and POKEs that
  120. BASIC requires. If you want to change
  121. the background, border, or text
  122. color, COMAL has commands to do it.
  123. If you want to use regular or high
  124. resolution graphics, COMAL has the
  125. commands to do it, and if you want to
  126. use the tremendous graphics
  127. capabilities of the C64, COMAL has
  128. sprite commands.
  129.  
  130. These commands let you define,
  131. identify, move, and hide sprites. If
  132. you want to write games, COMAL has
  133. commands to detect collisions between
  134. sprites, and collisions of sprites
  135. with text.
  136.  
  137. Now we come to user support. COMAL
  138. has a national users group, and small
  139. special interest groups attached to
  140. most Commodore clubs. COMAL USA
  141. publishes a magazine that deals only
  142. with COMAL. They also distribute
  143. public domain COMAL programs on disk.
  144. To the best of my knowledge, there
  145. are no national support groups for
  146. C64 Pascal, C, FORTRAN, COBOL, or
  147. Simon's BASIC. COMAL USA also
  148. maintains electronic bulletin boards
  149. (BBS) on several of the commercial
  150. telecommunications systems. If you're
  151. wondering why the USA (in COMAL USA)
  152. it is because COMAL is the official
  153. educational programming language for
  154. 5 European countries. Since COMAL is
  155. a "standardized" language, programs
  156. written on any computer will work on
  157. any other computer that supports
  158. COMAL, including the IBM PC.
  159.  
  160. COMAL is available on the C64 in two
  161. ways. The disk loaded version 0.14 is
  162. on this Ahoy disk. A more powerful
  163. version of COMAL 2.0 is available in
  164. a cartridge, which works with the C64
  165. and the C128. It costs $74.95 plus
  166. $2.00 shipping. You can obtain these
  167. items along with 18 other COMAL books
  168. from COMAL USA. The standard
  169. reference book for COMAL is the COMAL
  170. Handbook by Len Lindsay.
  171.  
  172. So, to answer the original question,
  173. COMAL is the best first computer
  174. language, but it may be the only
  175. computer language that you'll ever
  176. need to learn.
  177.